package cn.mccraft.uide.api.util.i18n;

import java.util.ResourceBundle;

import javax.annotation.Nonnull;

public interface I18n {
	
	public String localize(@Nonnull String key);
	
	default public String localize(@Nonnull String key, Object... values) {
		Object localizedValues[] = new String[values.length];
		for (int i = 0; i < values.length; i++) {
			localizedValues[i] = values[i] instanceof String ? localize((String) values[i]) : values[i];
		}
		return String.format(localize(key), localizedValues);
	}
	
	public ResourceBundle getResourceBundle();
}
